import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import ConsoleView from '@/views/ConsoleView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView
    },
    {
      path: '/console',
      name: 'console',
      component: ConsoleView,
      redirect: '/console/dashboard',
      meta: {
        title: '控制台'
      },
      children:[
        {
          path: 'dashboard',
          name: 'console',
          component: () => import('@/pages/console/dashboard/IndexPage.vue'),
          meta: {
            title: '仪表盘'
          }
        }
      ]
    }
  ]
})

export default router
